package com.fedoom.frontend.models;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.LinkedList;

public class CommandLineFileLoader {

	//list stores command line options
	public static LinkedList<String> commands;
	
	//constructor
	public CommandLineFileLoader(String filename){
		loadFile(filename);
	}
	
	//loads command line file
	private void loadFile(String filename){
		
		commands = new LinkedList<String>();
		
		try{
		    BufferedReader in = new BufferedReader(new FileReader(filename));
		    String str;
		    
		    while ((str = in.readLine()) != null) {
		    	commands.add(str);
		    }
		    in.close();
		} catch(IOException e){
			e.printStackTrace();
		}
	}


	//getter-setters
	public static LinkedList<String> getCommands() {
		return commands;
	}	
	
}
